#ifndef COMMON_GRAPHICS_INDEX_BUFFER_H
#define COMMON_GRAPHICS_INDEX_BUFFER_H


#include "GraphicsResource.h"


class IndexBuffer : public GraphicsResource
{

public:
    enum Usage
    {
        kStatic,
        kStreaming,
        kDynamic
    };
    enum IndexType
    {
        kIndex8 = 1,
        kIndex16 = 2,
        kIndex32 = 4
    };

                    IndexBuffer(Usage usage, IndexType indexType, size_t indexCount);
                    ~IndexBuffer();

    IndexType       GetIndexType() const;
    size_t          GetIndexCount() const;

private:
    IndexType       type;
    size_t          count;
};


void BindIndexBuffer(const IndexBuffer* buffer);
void SetIndexData(const IndexBuffer* buffer, const void* indexData, size_t indexOffset, size_t indexCount);


#endif
